package edu.msg.jthr.backend.model;

import java.io.Serializable;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * The base entity's class
 * 
 * @author Adorjan
 * 
 */
@MappedSuperclass
public class BaseEntity extends AbstractModel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private Long id;

	/**
	 * Default constructor
	 */
	public BaseEntity() {
		this(null);
	}

	/**
	 * Parameterized constructor
	 * 
	 * @param id
	 */
	public BaseEntity(final Long id) {
		super();
		this.id = id;
	}

	/**
	 * This method returns the id
	 * 
	 * @return id
	 */
	@Id
	@GeneratedValue(strategy =GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	/**
	 * This method sets the id
	 * 
	 * @param id
	 */
	public void setId(final Long id) {
		this.id = id;
	}
}
